<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="订单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanBianhao" v-has="'leaveReason'" >
              <a-input v-model="model.dingdanBianhao" placeholder="请输入订单编号"   ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="订单类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanLeixing">
              <j-dict-select-tag type="list" v-model="model.dingdanLeixing" dictCode="dingdan_leixing" placeholder="请选择订单类型" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="任务名称1111" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskName">
              <a-input v-model="model.taskName" placeholder="请输入任务名称"   ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="接单员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanJiedanyuan">
              <j-select-user-by-dep v-model="model.dingdanJiedanyuan" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="客户名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanKehu">
              <a-input v-model="model.dingdanKehu" placeholder="请输入客户名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="客户联系方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kehuDianhua">
              <a-input v-model="model.kehuDianhua" placeholder="请输入客户联系方式"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="订单要求" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanYaoqiu">
              <j-editor v-model="model.dingdanYaoqiu" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="模型图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanTupian">
              <j-image-upload isMultiple  v-model="model.dingdanTupian" ></j-image-upload>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="订单状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanZhuangtai">
              <a-input v-model="model.dingdanZhuangtai" placeholder="请输入订单状态" disabled ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="下单时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanXiadanshijian">
              <j-date placeholder="请选择下单时间"  v-model="model.dingdanXiadanshijian" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="模型重克" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanMoxingzhongliang">
              <a-input v-model="model.dingdanMoxingzhongliang" placeholder="请输入模型重克"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="模型件数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanShuliang">
              <a-input-number v-model="model.dingdanShuliang" placeholder="请输入模型件数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="货款状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanHuokuan">
              <j-dict-select-tag type="radio" v-model="model.dingdanHuokuan" dictCode="daikuan_status" placeholder="请选择货款状态" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="发货方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanFahuofangshi">
              <j-dict-select-tag type="radio" v-model="model.dingdanFahuofangshi" dictCode="fahuo_status" placeholder="请选择发货方式" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设计人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shejiRenyuan">
              <j-select-user-by-dep v-model="model.shejiRenyuan" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设计要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shejiRenyuanYaoqiuDate">
              <j-date placeholder="请选择设计要求时间"  v-model="model.shejiRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设计完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shejiRenyuanWanchengDate">
              <j-date placeholder="请选择设计完成时间"  v-model="model.shejiRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设计评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shejiRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.shejiRenyuanPingfen" dictCode="pingfen" placeholder="请选择设计评分" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="编程人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bianchengRenyuan">
              <j-select-user-by-dep v-model="model.bianchengRenyuan" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="编程要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bianchengRenyuanYaoqiuDate">
              <j-date placeholder="请选择编程要求时间"  v-model="model.bianchengRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="编程完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bianchengRenyuanWanchengDate">
              <j-date placeholder="请选择编程完成时间"  v-model="model.bianchengRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="编程评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bianchengRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.bianchengRenyuanPingfen" dictCode="pingfen" placeholder="请选择编程评分" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上机人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangjiRenyuan">
              <j-select-user-by-dep v-model="model.shangjiRenyuan" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上机要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangjiRenyuanYaoqiuDate">
              <j-date placeholder="请选择上机要求时间"  v-model="model.shangjiRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上机完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangjiRenyuanWanchengDate">
              <j-date placeholder="请选择上机完成时间"  v-model="model.shangjiRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上机评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangjiRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.shangjiRenyuanPingfen" dictCode="pingfen" placeholder="请选择上机评分" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="清洗人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qingxiRenyuan">
              <j-select-user-by-dep v-model="model.qingxiRenyuan"  :disabled="isDisabledAuth('shengchan')" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="清洗完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qingxiRenyuanWanchengDate">
              <j-date placeholder="请选择清洗完成时间"  v-model="model.qingxiRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" :disabled="isDisabledAuth('shengchan')" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="清洗要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qingxiRenyuanYaoqiuDate">
              <j-date placeholder="请选择清洗要求时间"  v-model="model.qingxiRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"  :disabled="isDisabledAuth('shengchan')"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="清洗评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qingxiRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.qingxiRenyuanPingfen" dictCode="pingfen" placeholder="请选择清洗评分" :disabled="isDisabledAuth('shengchan')" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="打磨人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="damoRenyuan">
              <j-select-user-by-dep v-model="model.damoRenyuan" :disabled="isDisabledAuth('shengchan')"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="打磨要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="damoRenyuanYaoqiuDate">
              <j-date placeholder="请选择打磨要求时间"  v-model="model.damoRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"  :disabled="isDisabledAuth('shengchan')"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="打磨完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="damoRenyuanWanchengDate">
              <j-date placeholder="请选择打磨完成时间"  v-model="model.damoRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"  :disabled="isDisabledAuth('shengchan')"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="打磨评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="damoRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.damoRenyuanPingfen" dictCode="pingfen" placeholder="请选择打磨评分"  :disabled="isDisabledAuth('shengchan')"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上色人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangseRenyuan">
              <j-select-user-by-dep v-model="model.shangseRenyuan" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上色要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangseRenyuanYaoqiuDate">
              <j-date placeholder="请选择上色要求时间"  v-model="model.shangseRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上色完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangseRenyuanWanchengDate">
              <j-date placeholder="请选择上色完成时间"  v-model="model.shangseRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上色评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangseRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.shangseRenyuanPingfen" dictCode="pingfen" placeholder="请选择上色评分" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="装配人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhuangpeiRenyuan">
              <j-select-user-by-dep v-model="model.zhuangpeiRenyuan" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="装配要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhuangpeiRenyuanYaoqiuDate">
              <j-date placeholder="请选择装配要求时间"  v-model="model.zhuangpeiRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="装配完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhuangpeiRenyuanWanchengDate">
              <j-date placeholder="请选择装配完成时间"  v-model="model.zhuangpeiRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="装配评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhuangpeiRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.zhuangpeiRenyuanPingfen" dictCode="pingfen" placeholder="请选择装配评分" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="质检人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhijianRenyuan">
              <j-select-user-by-dep v-model="model.zhijianRenyuan" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="质检要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhijianRenyuanYaoqiuDate">
              <j-date placeholder="请选择质检要求时间"  v-model="model.zhijianRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="质检完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhijianRenyuanWanchengDate">
              <j-date placeholder="请选择质检完成时间"  v-model="model.zhijianRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="质检评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zhijianRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.zhijianRenyuanPingfen" dictCode="pingfen" placeholder="请选择质检评分" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="发货人员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fahuoRenyuan">
              <j-select-user-by-dep v-model="model.fahuoRenyuan" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="发货要求时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fahuoRenyuanYaoqiuDate">
              <j-date placeholder="请选择发货要求时间"  v-model="model.fahuoRenyuanYaoqiuDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="发货完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fahuoRenyuanWanchengDate">
              <j-date placeholder="请选择发货完成时间"  v-model="model.fahuoRenyuanWanchengDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="发货评分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fahuoRenyuanPingfen">
              <j-dict-select-tag type="list" v-model="model.fahuoRenyuanPingfen" dictCode="pingfen" placeholder="请选择发货评分" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="单克金额报价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dankeJine">
              <a-input v-model="model.dankeJine" placeholder="请输入单克金额报价"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="订单预估金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanYuguJine">
              <a-input-number v-model="model.dingdanYuguJine" placeholder="请输入订单预估金额" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="订单实际金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanShijiJine">
              <a-input-number v-model="model.dingdanShijiJine" placeholder="请输入订单实际金额" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="订单材质" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dingdanCaizhi">
              <j-dict-select-tag type="list" v-model="model.dingdanCaizhi" dictCode="dingdan_caizhi" placeholder="请选择订单材质" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设计拆件数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shejiCaijianShuliang">
              <a-input v-model="model.shejiCaijianShuliang" placeholder="请输入设计拆件数量"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="下机拆件数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xiajiCaijianShuliang">
              <a-input v-model="model.xiajiCaijianShuliang" placeholder="请输入下机拆件数量"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="清洗拆件数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qingxiCaijianShuliang">
              <a-input v-model="model.qingxiCaijianShuliang" placeholder="请输入清洗拆件数量"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="打磨拆件数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="damoCaijianShuliang">
              <a-input v-model="model.damoCaijianShuliang" placeholder="请输入打磨拆件数量"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="上色拆件数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shangseCaijianShuliang">
              <a-input v-model="model.shangseCaijianShuliang" placeholder="请输入上色拆件数量"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="组装拆件数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zuzhuangCaijianShuliang">
              <a-input v-model="model.zuzhuangCaijianShuliang" placeholder="请输入组装拆件数量"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col v-if="showFlowSubmitButton" :span="24" style="width: 100%;text-align: center;">
            <a-button icon="check" style="width: 126px" type="primary" @click="submitForm">提 交</a-button>
          </a-col>
        </a-row>
    </j-form-container>
  </a-spin>
</template>

<script>

  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  import {DisabledAuthFilterMixin} from '@/mixins/DisabledAuthFilterMixin'

  export default {
    name: 'TableDayinCopyFormBpm',
    mixins: [DisabledAuthFilterMixin],
    components: {
    },
    props: {
      //流程表单data
      formData: {
        type: Object,
        default: ()=>{},
        required: false
      },
      //表单模式：true流程表单 false普通表单
      formBpm: {
        type: Boolean,
        default: false,
        required: false
      },
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{
         },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
       /* validatorRules: {
           taskName: [
              { required: true, message: '请输入任务名称!'},
           ],
           dingdanJiedanyuan: [
              { required: true, message: '请输入接单员!'},
           ],
           dingdanKehu: [
              { required: true, message: '请输入客户名称!'},
           ],
           kehuDianhua: [
              { required: true, message: '请输入客户联系方式!'},
              { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'},
           ],
           dingdanYaoqiu: [
              { required: true, message: '请输入订单要求!'},
           ],
           dingdanXiadanshijian: [
              { required: true, message: '请输入下单时间!'},
           ],
           dingdanMoxingzhongliang: [
              { required: false},
              { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
           ],
           dingdanShuliang: [
              { required: true, message: '请输入模型件数!'},
              { pattern: /^-?\d+$/, message: '请输入整数!'},
           ],
           dingdanHuokuan: [
              { required: true, message: '请输入货款状态!'},
           ],
           shejiRenyuan: [
              { required: true, message: '请输入设计人员!'},
           ],
           shejiRenyuanYaoqiuDate: [
              { required: true, message: '请输入设计要求时间!'},
           ],
           shejiRenyuanWanchengDate: [
              { required: true, message: '请输入设计完成时间!'},
           ],
           shejiRenyuanPingfen: [
              { required: true, message: '请输入设计评分!'},
           ],
        },*/
        url: {
          add: "/dayincopy/tableDayinCopy/add",
          edit: "/dayincopy/tableDayinCopy/edit",
          queryById: "/dayincopy/tableDayinCopy/queryById"
        }
      }
    },
    computed: {
      formDisabled(){
        if(this.formBpm===true){
          if(this.formData.disabled===false){
            return false
          }
          return true
        }
        return this.disabled
      },
      showFlowSubmitButton(){
        if(this.formBpm===true){
          if(this.formData.disabled===false){
            return true
          }
        }
        return false
      }
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
      //如果是流程中表单，则需要加载流程表单data
      this.showFlowData();
      var params = {id:this.formData.dataId};//查询条件
      getAction(this.url.queryById,params).then((res)=>{
        if(res.success){
          this.edit (res.result);
        }
      })
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      //渲染流程表单数据
      showFlowData(){
        if(this.formBpm === true){
          let params = {id:this.formData.dataId};
          getAction(this.url.queryById,params).then((res)=>{
            if(res.success){
              this.edit (res.result);
            }
          });
        }
      },
      submitForm () {
        const that = this;
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
          }
         
        })
      },
    }
  }
</script>